<%@page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.gsdxsys.dao.impl.AdminDaoImpl" import="com.gsdxsys.entity.Admin" import="com.gsdxsys.service.AdminService" import="com.gsdxsys.service.impl.AdminServiceImpl"%>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎来到注册页面</title>
</head> 
<body>
<%
    request.setCharacterEncoding("utf-8");
	String uid=request.getParameter("username");
	String pwd=request.getParameter("password");
	String realname=request.getParameter("realname");
	//AdminDaoImpl AD=new AdminDaoImpl();
	Admin admin=new Admin();
	admin.setUsername(uid);
	admin.setPassword(pwd);
	admin.setRealname(realname);
	AdminService service=new AdminServiceImpl();
	int result=service.reg(admin);
	if(result>0){
		out.print("reg ok!");
	}else if(result==-1){
		out.print("账号已经存在不能注册！");
	}else{
		out.print("reg not ok!");
	}
%>
</body>
</html>